package learnjava.interview;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Dahua2 {

//    public static void main(String[] args) throws ParseException {
//
//        System.out.println(interval("41282719950912451X"));
//    }
//
//    public static int interval(String idCard) throws ParseException {
//
//        Date birth = new SimpleDateFormat("yyyyMMdd").parse(idCard.substring(6,14));
//
//        Date now = new Date();
//
//        //如果是2.29要特殊处理
//        if(birth.getMonth()==1&&birth.getDay()==29){
//            //寻找下一个闰年，先看看今年是不是闰年
//            if(now.getYear()%4==0&&now.getYear()%100!=0||now.getYear()%400==0){
//                //查看当前生日过了没有
//            }
//        }
//
////        //不知今年生日过了没有
////        birth.setYear(date.getYear());
////
////        if(date.after(birth)){ //生日已过
////            birth.setYear(date.getYear()+1);
////        }
////
////        //计算差值
////        Calendar c1 = Calendar.getInstance();
////        c1.setTime(date);
////        long t1 = c1.getTimeInMillis();
////
////        Calendar c2 = Calendar.getInstance();
////        c2.setTime(birth);
////        long t2 = c2.getTimeInMillis();
////
////        return (int)(t2-t1)/1000/3600/24;
//    }

}
